package com.riant.test7.threadpool;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;

public class TestDemo {

    public static void main(String[] args) {
        ArrayBlockingQueue<String> arrayBlockingQueue=new ArrayBlockingQueue(4);
        Thread thread=new Thread(new Runnable() {
            @Override
            public void run() {
                boolean object= false;
                object = arrayBlockingQueue.offer("1");
                //object = arrayBlockingQueue.take();
                System.out.println(object);
            }
        });

        arrayBlockingQueue.offer("1");
        arrayBlockingQueue.offer("1");
        arrayBlockingQueue.offer("1");
        arrayBlockingQueue.offer("1");
        arrayBlockingQueue.offer("1");
        thread.start();
        System.out.println(arrayBlockingQueue.size());
        //arrayBlockingQueue.poll();
        //ThreadPoolExecutor threadPoolExecutor=new ThreadPoolExecutor();
    }
}
